# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=gedit
pkgver=3.22.1+1+gd21912e3e
pkgrel=1
pkgdesc="GNOME Text Editor"
url="https://wiki.gnome.org/Apps/Gedit"
arch=(i686 x86_64)
license=(GPL)
depends=(gtksourceview3 gsettings-desktop-schemas libpeas gspell python-gobject dconf)
makedepends=(yelp-tools intltool vala gobject-introspection gnome-common git gtk-doc)
optdepends=('gedit-plugins: Additional features')
groups=(gnome-extra)
_commit=d21912e3e29a082461a49b2f6b5df579bb572cc6  # master
source=("git+https://git.gnome.org/browse/gedit#commit=$_commit"
        "git+https://git.gnome.org/browse/libgd")
sha256sums=('SKIP'
            'SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname

  git submodule init
  git config --local submodule.libgd.url "$srcdir/libgd"
  git submodule update

  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr \
      --sysconfdir=/etc --localstatedir=/var \
      --libexecdir=/usr/lib --disable-updater --disable-schemas-compile \
      --enable-python --enable-gtk-doc
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package(){
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
